<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
<!--
	$(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
	$("#link_name").formValidator({onshow:"请输入网站名称",onfocus:"请输入网站名称"}).inputValidator({min:1,onerror:"请输入网站名称"});
 	$("#link_url").formValidator({onshow:"请输入网站网址",onfocus:"请输入网站网址"}).inputValidator({min:1,onerror:"请输入网站网址"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"格式应该为http://www.cjli.org/"})
	 
	})
//-->
</script>

<div class="pad_10">
<form action="__SELF__" method="post" name="myform" id="myform" enctype="multipart/form-data">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
	<tr>
		<th width="100">链接类型：</th>
		<td>
		<input name="link[linktype]" type="radio" value="1" <?php echo $link['linktype']==1 ? 'checked="checked"' : '';?> style="border:0" onclick="$('#logolink').show()" class="radio_style">
	LOGO链接&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="link[linktype]" value="0" <?php echo $link['linktype']==0 ? 'checked="checked"' : '';?> style="border:0" onclick="$('#logolink').hide()" class="radio_style">
	文字链接		</td>
	</tr>
	<tr>
		<th width="100">网站名称：</th>
		<td><input type="text" name="link[name]" value="<?php echo $link['name'];?>" id="link_name"	size="30" class="input-text"></td>
	</tr>
	<tr>
		<th width="100">网站网址：</th>
		<td><input type="text" name="link[url]" value="<?php echo $link['url'];?>" id="link_url" size="30" class="input-text"></td>
	</tr>
	<?php if($link['linktype']==1):?>
	<tr id="logolink">
		<th width="100">图片LOGO：</th>
		<td>
		<input type="hidden" name="link[logo]" value="<?php echo $link['logo'];?>" />
		<input type="file" name="upimage" id="upimage" value="" size="50" class="" />
		<?php if($link['logo']){?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:showImage('<?php echo $link['logo'];?>')">【预览图片】</a><?php }?></td>
	</tr>
	<?php endif;?>
	<tr>
		<th width="100">网站联系人：</th>
		<td><input type="text" name="link[username]" id="link_username" value="<?php echo $link['username'];?>"	size="30" class="input-text"></td>
	</tr>
	<tr>
		<th>网站介绍：</th>
		<td><textarea name="link[description]" id="description" cols="50"	rows="6"><?php echo $link['description'];?></textarea></td>
	</tr>
	<tr>
		<th>推 荐：</th>
		<td><input name="link[istop]" type="radio" value="1" <?php echo $link['istop']==1 ? 'checked="checked"' : '';?>>&nbsp;是&nbsp;&nbsp;<input
			name="link[istop]" type="radio" value="0" <?php echo $link['istop']==0 ? 'checked="checked"' : '';?>>&nbsp;否</td>
	</tr>
	<tr>
		<th>通过：</th>
		<td><input name="link[disabled]" type="radio" value="1" <?php echo $link['disabled']==1 ? 'checked="checked"' : '';?>>&nbsp;是&nbsp;&nbsp;<input
			name="link[disabled]" type="radio" value="0" <?php echo $link['disabled']==0 ? 'checked="checked"' : '';?>>&nbsp;否</td>
	</tr>
</table>
<div class="bk15"></div>
    <input name="dosubmit" type="submit" class="dialog" value="提交" id="dosubmit" />
</form>
</div>
</body>
</html> 